﻿<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
  <title>北京电子信息技师学院-信息管理系统</title>
  <link rel='stylesheet' type='text/css' href="login/custom/reset.css"/>
  <link rel='stylesheet' type='text/css' href="login/custom/login.css"/>
  <script type='text/javascript' src='login/custom/jquery1.7.2.js'></script>
  <script type="text/javascript" src="login/loginN4.js"></script>
  <script type="text/javascript" src="login/digestLoginN4.js"></script>
  <script type="text/javascript" src="login/core/auth.min.js"></script>
</head>
<body>
  <div id="login-bg">
    <img src="login/custom/login.png">
  </div>
  <div class="login-logo">
    <img src="login/custom/login_logo.png"><span>北京电子信息技师学院</span>
  </div>
  <img class="login-img" src="login/custom/login_img.png">
  <div class="login-box">
    <div class="login-box-bg">
      <div class="login-box-bg-inner">
        <img src="login/custom/login_box.png">
      </div>
    </div>
    <div class="login-title">北电信息技师管理系统</div>
    <div class="login-box-body">
      <div class="login-box-form">
        <div id="login-failed" style="display: none">登录失败</div>
        <form id="login-form" method="post" action=j_security_check>
          <input type="text" class="form-control" name="j_username" id="username" value="[nameTag]"
                 placeholder="请输入用户名">
          <input type="password" class="form-control" name="j_password" id='password' autocomplete="off" autofocus
                 placeholder="请输入密码">
          <div class="login-btns">
            <div id="changeUser" class="btn">切换用户</div>
            <div id="loginBtn" type="submit" class="btn" onclick="return doLogin();">
              登　录
            </div>
          </div>
        </form>
      </div>
    </div>
    <div class="toolbar">
      TJHZZX&copy;&nbsp;管理平台
    </div>
    <div id="lmessage" ltag="[ltag]" style="display: none;"><p  style="color: red;" >请检查license是否已安装</p></div>
  </div>
  <script>
    function getQueryVariable(variable) {
      const query = window.location.search.substring(1);
      const vars = query.split("&");
      for (let i=0;i<vars.length;i++) {
        const pair = vars[i].split("=");
        if(pair[0] == variable){
          return pair[1];
        }
      }
      return(false);
    }
    $(function () {
      if ($("#lmessage").attr("ltag") == 1){
        $("#lmessage").hide();
        $("#loginBtn").show();
      }else {
        $("#lmessage").show();
        $("#loginBtn").hide();
      }
      $("#changeUser").click(function (event) {
        event.preventDefault();
        location.href = "/prelogin?clear=true";
      });
      let focus = false;
      $(document).on("keydown", function (event) {
        const e = event || window.event || arguments.callee.caller.arguments[0];
        if (focus && e && e.keyCode == 13) {
          return doLogin();
        }
      });
      $('input').focus(function () {
        focus = true;
      });
      $('input').blur(function () {
        focus = false;
      });
      if (window != top) {
        top.location.href = location.href;
      }
      // $('#loginBtn').click(function() {
      //   if($('#username').trim() == '' || $('#password').trim() == '') {
      //     alert('用户名或密码不能为空！');
      //     return false;
      //   }
      //   return doLogin();
      // })
    });
  </script>
</body>
</html>
